<?php
class UserCustomerBasketEntityBase extends EntityBase
{
	public $id;
	public $customerId;
	public $productId;
	public $quantity;
	public $finalPrice;
	public $addedDate;
	
	const INACTIVE = 0;
	const ACTIVE = 1;
	
	public function __construct($arrValue = null, $prefix = '')
	{
		if(!is_null($arrValue) && is_array($arrValue))
		{
			$this->id = (int) ($arrValue[$prefix . 'id']);
			$this->customerId = strval ($arrValue[$prefix . 'customerId']);
			$this->productId = strval ($arrValue[$prefix . 'productId']);
			$this->quantity = strval ($arrValue[$prefix . 'quantity']);
			$this->finalPrice = strval ($arrValue[$prefix . 'finalPrice']);
			$this->addedDate = strval ($arrValue[$prefix . 'addedDate']);			
		}
	}

	/**
	 * Get all fields for selecting columns
	 *
	 * @param string $alias: alias of table
	 * @param string $prefix
	 * @return string
	 */
	public static function getSelectColumns($alias, $prefix = '')
	{
		$arrValue = array(
						"{$alias}.id AS `{$prefix}id`",
						"{$alias}.customerId AS `{$prefix}customerId`",
						"{$alias}.productId AS `{$prefix}productId`",
						"{$alias}.quantity AS `{$prefix}quantity`",
						"{$alias}.finalPrice AS `{$prefix}finalPrice`",
						"{$alias}.addedDate AS `{$prefix}addedDate`",																	
		);

		return implode(',', $arrValue);
	}
}